<script langauage='javascript'>
function daterange_disable(f,n,d) {
	f["_"+n+"_year"].disabled = d;
	f["_"+n+"_month"].disabled = d;
	f["_"+n+"_day"].disabled = d;
	}
</script>
	
<?



echo "<table>";

$r = array(
	array("Start","datestart",$params["record"]["datestart"]),
	array("Finish","dateend",$params["record"]["dateend"]),
	);

foreach ($r as $e) {
	list($title,$field,$value) = $e;

	echo "<tr>";
	$c = ($value==""?"":"checked");
	echo "<td><input type='checkbox' $c name=\"{$params["name"]}[{$field}_enabled]\" value=\"1\" onclick='daterange_disable(form,\"$field\",!this.checked);'>";
	echo "<td>$title";
	echo "<td>";
	inc_incfile("fields3/easydate_edit.php",array(
		"name"=>$field,
		"value"=>$value,
		));
	if (!$value) {
		echo "<script language='javascript'>daterange_disable(document.edit,'$field',1);</script>";
		}
	}


echo "</table>";
?>